//package com.li.youhappygo.config;
//
//import com.baomidou.mybatisplus.annotation.DbType;
//import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
//import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
//import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
//import com.github.pagehelper.PageHelper;
//import com.github.pagehelper.PageInterceptor;
////import okhttp3.Interceptor;
//import org.apache.ibatis.plugin.Interceptor;
//import org.apache.ibatis.session.SqlSessionFactory;
//import org.checkerframework.checker.units.qual.A;
//import org.mybatis.spring.SqlSessionFactoryBean;
//import org.mybatis.spring.annotation.MapperScan;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Qualifier;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.context.annotation.Primary;
//import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
//
//import javax.sql.DataSource;
//import java.util.Properties;
//
//@Configuration
//@MapperScan("com.li.youhappygo.mapper")
//public class MabitsConfig {
//
//    @Autowired
//    @Qualifier("mybatisPlusPageInterceptor")
//    MybatisPlusInterceptor mybatisPlusPageInterceptor;
//
//
//    @Bean(name = "dataSqlSessionFactory")
//    @Primary
//    public SqlSessionFactory sqlSessionFactory(@Qualifier("dataSource") DataSource dataSource) throws Exception {
//        // 解决 Invalid bound statement 问题
//        MybatisSqlSessionFactoryBean bean = new MybatisSqlSessionFactoryBean();
//
//        bean.setDataSource(dataSource);
//
//        //重点加上这个bean的配置
//        Interceptor[] plugins = {mybatisPlusPageInterceptor};
//        bean.setPlugins(plugins);
//
//        bean.setTypeAliasesPackage("com.li.youhappygo.mapper");
////        bean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath*:mapper/**/*.xml"));
//        return bean.getObject();
//    }
//
//
//}
